using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._AnalyzingPatterns
{
    /// <summary>
    /// <para>Multi-Distance Spatial Cluster Analysis </para>
    /// <para>Determines whether features, or the values associated with features, exhibit statistically significant clustering or dispersion over a range of distances.</para>
    /// <para>确定要素或与要素关联的值是否在一定距离范围内表现出统计显著的聚类或离散。</para>
    /// </summary>    
    [DisplayName("Multi-Distance Spatial Cluster Analysis ")]
    public class MultiDistanceSpatialClustering : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MultiDistanceSpatialClustering()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Feature_Class">
        /// <para>Input Feature Class</para>
        /// <para>The feature class upon which the analysis will be performed.</para>
        /// <para>将对其执行分析的要素类。</para>
        /// </param>
        /// <param name="_Output_Table">
        /// <para>Output Table</para>
        /// <para>The table to which the results of the analysis will be written.</para>
        /// <para>将分析结果写入其中的表。</para>
        /// </param>
        /// <param name="_Number_of_Distance_Bands">
        /// <para>Number of Distance Bands</para>
        /// <para>The number of times to increment the neighborhood size and analyze the dataset for clustering. The starting point and size of the increment are specified in the Beginning Distance and Distance Increment parameters, respectively.</para>
        /// <para>递增邻域大小和分析数据集进行聚类的次数。增量的起点和大小分别在“起始距离”和“距离增量”参数中指定。</para>
        /// </param>
        public MultiDistanceSpatialClustering(object _Input_Feature_Class, object _Output_Table, long _Number_of_Distance_Bands)
        {
            this._Input_Feature_Class = _Input_Feature_Class;
            this._Output_Table = _Output_Table;
            this._Number_of_Distance_Bands = _Number_of_Distance_Bands;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Multi-Distance Spatial Cluster Analysis ";

        public override string CallName => "stats.MultiDistanceSpatialClustering";

        public override List<string> AcceptEnvironments => ["geographicTransformations", "outputCoordinateSystem", "randomGenerator", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Feature_Class, _Output_Table, _Number_of_Distance_Bands, _Compute_Confidence_Envelope.GetGPValue(), _Display_Results_Graphically.GetGPValue(), _Weight_Field, _Beginning_Distance, _Distance_Increment, _Boundary_Correction_Method.GetGPValue(), _Study_Area_Method.GetGPValue(), _Study_Area_Feature_Class, _Result_Image];

        /// <summary>
        /// <para>Input Feature Class</para>
        /// <para>The feature class upon which the analysis will be performed.</para>
        /// <para>将对其执行分析的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Feature_Class { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para>The table to which the results of the analysis will be written.</para>
        /// <para>将分析结果写入其中的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Output_Table { get; set; }


        /// <summary>
        /// <para>Number of Distance Bands</para>
        /// <para>The number of times to increment the neighborhood size and analyze the dataset for clustering. The starting point and size of the increment are specified in the Beginning Distance and Distance Increment parameters, respectively.</para>
        /// <para>递增邻域大小和分析数据集进行聚类的次数。增量的起点和大小分别在“起始距离”和“距离增量”参数中指定。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Distance Bands")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long _Number_of_Distance_Bands { get; set; }


        /// <summary>
        /// <para>Compute Confidence Envelope</para>
        /// <para><xdoc>
        ///   <para>The confidence envelope is calculated by randomly placing feature points (or feature values) in the study area. The number of points/values randomly placed is equal to the number of points in the feature class. Each set of random placements is called a permutation and the confidence envelope is created from these permutations. This parameter allows you to select how many permutations you want to use to create the confidence envelope.</para>
        ///   <bulletList>
        ///     <bullet_item>0 permutations - no confidence envelope—Confidence envelopes are not created.</bullet_item><para/>
        ///     <bullet_item>9 permutations—Nine sets of points/values are randomly placed.</bullet_item><para/>
        ///     <bullet_item>99 permutations—99 sets of points/values are randomly placed.</bullet_item><para/>
        ///     <bullet_item>999 permutations—999 sets of points/values are randomly placed.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>置信包络是通过在研究区域中随机放置特征点（或特征值）来计算的。随机放置的点数/值数等于要素类中的点数。每组随机放置称为置换，置信包络由这些置换创建。此参数允许您选择要用于创建置信度包络的排列数。</para>
        ///   <bulletList>
        ///     <bullet_item>0 排列 - 无置信包络 - 不创建置信度包络。</bullet_item><para/>
        ///     <bullet_item>9 排列 - 随机放置 9 组点/值。</bullet_item><para/>
        ///     <bullet_item>99 种排列 - 随机放置 99 组点/值。</bullet_item><para/>
        ///     <bullet_item>999 排列 - 随机放置 999 组点/值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compute Confidence Envelope")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Compute_Confidence_Envelope_value _Compute_Confidence_Envelope { get; set; } = _Compute_Confidence_Envelope_value.value0;

        public enum _Compute_Confidence_Envelope_value
        {
            /// <summary>
            /// <para>0 permutations - no confidence envelope</para>
            /// <para>0 permutations - no confidence envelope—Confidence envelopes are not created.</para>
            /// <para>0 排列 - 无置信包络 - 不创建置信度包络。</para>
            /// </summary>
            [Description("0 permutations - no confidence envelope")]
            [GPEnumValue("0_PERMUTATIONS_-_NO_CONFIDENCE_ENVELOPE")]
            value0,

            /// <summary>
            /// <para>9 permutations</para>
            /// <para>9 permutations—Nine sets of points/values are randomly placed.</para>
            /// <para>9 排列 - 随机放置 9 组点/值。</para>
            /// </summary>
            [Description("9 permutations")]
            [GPEnumValue("9_PERMUTATIONS")]
            _9_PERMUTATIONS,

            /// <summary>
            /// <para>99 permutations</para>
            /// <para>99 permutations—99 sets of points/values are randomly placed.</para>
            /// <para>99 种排列 - 随机放置 99 组点/值。</para>
            /// </summary>
            [Description("99 permutations")]
            [GPEnumValue("99_PERMUTATIONS")]
            _99_PERMUTATIONS,

            /// <summary>
            /// <para>999 permutations</para>
            /// <para>999 permutations—999 sets of points/values are randomly placed.</para>
            /// <para>999 排列 - 随机放置 999 组点/值。</para>
            /// </summary>
            [Description("999 permutations")]
            [GPEnumValue("999_PERMUTATIONS")]
            _999_PERMUTATIONS,

        }

        /// <summary>
        /// <para>Display Results Graphically</para>
        /// <para>This parameter has no effect; it remains to support backward compatibility.</para>
        /// <para>此参数不起作用;它仍然支持向后兼容性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Display Results Graphically")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Display_Results_Graphically_value? _Display_Results_Graphically { get; set; } = null;

        public enum _Display_Results_Graphically_value
        {
            /// <summary>
            /// <para>DISPLAY_IT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DISPLAY_IT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_DISPLAY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_DISPLAY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Weight Field</para>
        /// <para>A numeric field with weights representing the number of features/events at each location.</para>
        /// <para>一个数值字段，其权重表示每个位置的要素/事件数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Weight Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Weight_Field { get; set; } = null;


        /// <summary>
        /// <para>Beginning Distance</para>
        /// <para>The distance at which to start the cluster analysis and the distance from which to increment. The value entered for this parameter should be in the units of the Output Coordinate System.</para>
        /// <para>开始聚类分析的距离和从中递增的距离。为此参数输入的值应为输出坐标系的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Beginning Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _Beginning_Distance { get; set; } = null;


        /// <summary>
        /// <para>Distance Increment</para>
        /// <para>The distance to increment during each iteration. The distance used in the analysis starts at the Beginning Distance and increments by the amount specified in the Distance Increment. The value entered for this parameter should be in the units of the Output Coordinate System environment setting.</para>
        /// <para>每次迭代期间要递增的距离。分析中使用的距离从“起始距离”开始，并按“距离增量”中指定的量递增。为此参数输入的值应为输出坐标系环境设置的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Increment")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _Distance_Increment { get; set; } = null;


        /// <summary>
        /// <para>Boundary Correction Method</para>
        /// <para><xdoc>
        ///   <para>Method to use to correct for underestimates in the number of neighbors for features near the edges of the study area.</para>
        ///   <bulletList>
        ///     <bullet_item>None—No edge correction is applied. However, if the input feature class already has points that fall outside the study area boundaries, these will be used in neighborhood counts for features near boundaries.</bullet_item><para/>
        ///     <bullet_item>Simulate outer boundary values—This method simulates points outside the study area so that the number of neighbors near edges is not underestimated. The simulated points are the "mirrors" of points near edges within the study area boundary.</bullet_item><para/>
        ///     <bullet_item>Reduce analysis area—This method shrinks the study area such that some points are found outside of the study area boundary. Points found outside the study area are used to calculate neighbor counts but are not used in the cluster analysis itself.</bullet_item><para/>
        ///     <bullet_item>Ripley's edge correction formula—For all the points (j) in the neighborhood of point i, this method checks to see if the edge of the study area is closer to i, or if j is closer to i. If j is closer, extra weight is given to the point j. This edge correction method is only appropriate for square or rectangular shaped study areas.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于校正研究区域边缘附近要素的邻域数低估的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>无 （None） - 不应用边校正。但是，如果输入要素类已具有位于研究区域边界之外的点，则这些点将用于边界附近要素的邻域计数。</bullet_item><para/>
        ///     <bullet_item>模拟外部边界值 - 此方法模拟研究区域外的点，以便不会低估边附近的邻居数量。模拟点是研究区域边界内边附近点的“镜像”。</bullet_item><para/>
        ///     <bullet_item>缩小分析区域 - 此方法可缩小研究区域，以便在研究区域边界之外找到某些点。在研究区域外发现的点用于计算相邻计数，但不用于聚类分析本身。</bullet_item><para/>
        ///     <bullet_item>Ripley 边校正公式 - 对于点 i 邻域中的所有点 （j），此方法将检查研究区域的边是否更接近 i，或者 j 是否更接近 i。如果 j 更近，则对点 j 给予额外的权重。此边缘校正方法仅适用于正方形或矩形研究区域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Boundary Correction Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Boundary_Correction_Method_value _Boundary_Correction_Method { get; set; } = _Boundary_Correction_Method_value._NONE;

        public enum _Boundary_Correction_Method_value
        {
            /// <summary>
            /// <para>None</para>
            /// <para>None—No edge correction is applied. However, if the input feature class already has points that fall outside the study area boundaries, these will be used in neighborhood counts for features near boundaries.</para>
            /// <para>无 （None） - 不应用边校正。但是，如果输入要素类已具有位于研究区域边界之外的点，则这些点将用于边界附近要素的邻域计数。</para>
            /// </summary>
            [Description("None")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Simulate outer boundary values</para>
            /// <para>Simulate outer boundary values—This method simulates points outside the study area so that the number of neighbors near edges is not underestimated. The simulated points are the "mirrors" of points near edges within the study area boundary.</para>
            /// <para>模拟外部边界值 - 此方法模拟研究区域外的点，以便不会低估边附近的邻居数量。模拟点是研究区域边界内边附近点的“镜像”。</para>
            /// </summary>
            [Description("Simulate outer boundary values")]
            [GPEnumValue("SIMULATE_OUTER_BOUNDARY_VALUES")]
            _SIMULATE_OUTER_BOUNDARY_VALUES,

            /// <summary>
            /// <para>Reduce analysis area</para>
            /// <para>Reduce analysis area—This method shrinks the study area such that some points are found outside of the study area boundary. Points found outside the study area are used to calculate neighbor counts but are not used in the cluster analysis itself.</para>
            /// <para>缩小分析区域 - 此方法可缩小研究区域，以便在研究区域边界之外找到某些点。在研究区域外发现的点用于计算相邻计数，但不用于聚类分析本身。</para>
            /// </summary>
            [Description("Reduce analysis area")]
            [GPEnumValue("REDUCE_ANALYSIS_AREA")]
            _REDUCE_ANALYSIS_AREA,

            /// <summary>
            /// <para>Ripley's edge correction formula</para>
            /// <para>Ripley's edge correction formula—For all the points (j) in the neighborhood of point i, this method checks to see if the edge of the study area is closer to i, or if j is closer to i. If j is closer, extra weight is given to the point j. This edge correction method is only appropriate for square or rectangular shaped study areas.</para>
            /// <para>Ripley 边校正公式 - 对于点 i 邻域中的所有点 （j），此方法将检查研究区域的边是否更接近 i，或者 j 是否更接近 i。如果 j 更近，则对点 j 给予额外的权重。此边缘校正方法仅适用于正方形或矩形研究区域。</para>
            /// </summary>
            [Description("Ripley's edge correction formula")]
            [GPEnumValue("RIPLEY_EDGE_CORRECTION_FORMULA")]
            _RIPLEY_EDGE_CORRECTION_FORMULA,

        }

        /// <summary>
        /// <para>Study Area Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the region to use for the study area. The K Function is sensitive to changes in study area size so careful selection of this value is important.</para>
        ///   <bulletList>
        ///     <bullet_item>Minimum enclosing rectangle—Indicates that the smallest possible rectangle enclosing all of the points will be used.</bullet_item><para/>
        ///     <bullet_item>User provided study area feature class—Indicates that a feature class defining the study area will be provided in the Study Area Feature Class parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要用于研究区域的区域。K 函数对研究区域大小的变化很敏感，因此仔细选择该值非常重要。</para>
        ///   <bulletList>
        ///     <bullet_item>最小封闭矩形 （Minimum encircle requangle） - 表示将使用包围所有点的最小可能矩形。</bullet_item><para/>
        ///     <bullet_item>用户提供的研究区域要素类 - 表示将在研究区要素类参数中提供定义研究区域的要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Study Area Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Study_Area_Method_value _Study_Area_Method { get; set; } = _Study_Area_Method_value._MINIMUM_ENCLOSING_RECTANGLE;

        public enum _Study_Area_Method_value
        {
            /// <summary>
            /// <para>Minimum enclosing rectangle</para>
            /// <para>Minimum enclosing rectangle—Indicates that the smallest possible rectangle enclosing all of the points will be used.</para>
            /// <para>最小封闭矩形 （Minimum encircle requangle） - 表示将使用包围所有点的最小可能矩形。</para>
            /// </summary>
            [Description("Minimum enclosing rectangle")]
            [GPEnumValue("MINIMUM_ENCLOSING_RECTANGLE")]
            _MINIMUM_ENCLOSING_RECTANGLE,

            /// <summary>
            /// <para>User provided study area feature class</para>
            /// <para>User provided study area feature class—Indicates that a feature class defining the study area will be provided in the Study Area Feature Class parameter.</para>
            /// <para>用户提供的研究区域要素类 - 表示将在研究区要素类参数中提供定义研究区域的要素类。</para>
            /// </summary>
            [Description("User provided study area feature class")]
            [GPEnumValue("USER_PROVIDED_STUDY_AREA_FEATURE_CLASS")]
            _USER_PROVIDED_STUDY_AREA_FEATURE_CLASS,

        }

        /// <summary>
        /// <para>Study Area Feature Class</para>
        /// <para>Feature class that delineates the area over which the input feature class should be analyzed. Only to be specified if User provided study area feature class is selected for the Study Area Method parameter.</para>
        /// <para>要素类，用于描述应分析输入要素类的区域。仅当为研究区域方法参数选择了用户提供的研究区域要素类时才指定。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Study Area Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Study_Area_Feature_Class { get; set; } = null;


        /// <summary>
        /// <para>Result Graph</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Result Graph")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _Result_Image { get; set; }


        public MultiDistanceSpatialClustering SetEnv(object geographicTransformations = null, object outputCoordinateSystem = null, object randomGenerator = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, randomGenerator: randomGenerator, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}